package com.woniuxy.automotivemanagementsystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("orders")
public class Orders {
    @TableId(value = "oid", type = IdType.AUTO)
    private Integer oid;//订单编号
    private  Integer uid;//用户编号
    private  Integer cid;//车辆编号
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;//开始时间
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;//结束时间
    private BigDecimal dailyRate;//当日租价
    private BigDecimal totalAmount;//总金额
    private  Integer status;//订单状态 0未审批 1审批未通过 2审批通过
    @TableField(exist = false)
    private User user;//用户信息
    @TableField(exist = false)
    private Car car;//车辆信息
}
